//
//  InformationCell.m
//  时尚男士
//
//  Created by dlios on 15-6-5.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "InformationCell.h"

@implementation InformationCell

- (id)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initLayout];
    }
    return self;
}
//初始化控件
- (void)initLayout{
    _title = [[UILabel alloc] init];
    [self.contentView addSubview:_title];
    _imgsrc = [[UIImageView alloc] init];
    [self.contentView addSubview:_imgsrc];
}
- (void)layoutSubviews
{
    CGFloat Height = self.contentView.frame.size.height;
    CGFloat width = self.contentView.frame.size.width / 3;
    _title.frame = CGRectMake(width + 5, 5, width * 2, Height);
    _imgsrc.frame = CGRectMake(5, 5, width, Height);
}
//- (void)setTitleText:(NSString *)text
//{
//    //获得当前cell高度
//    CGRect frame = [self frame];
//    //文本赋值
//    self.title.text = text;
//    //设置Label的最大行数
//    self.title.numberOfLines = 10;
//    CGSize size = CGSizeMake(300, 1000);
//    CGSize labelSize = [self.title.text sizeWithFont:self.title.font constrainedToSize:size lineBreakMode:NSLineBreakByClipping];
//    
//    self.title.frame = CGRectMake(self.title.frame.origin.x, self.title.frame.origin.y, labelSize.width, labelSize.height);
//    
//    //计算出自适应高度
//    frame.size.height = labelSize.height + 100;
//    self.frame = frame;
//}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
